package com.chandra.pos.product.dao;


import com.chandra.pos.SearchCriteria;
import com.chandra.pos.product.dao.entity.Product;
import com.chandra.pos.product.exception.ProductNotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.List;

/**
 * 
 * Product DAO Interface
 * 
 * @author onlinetechvision.com
 * @since 25 Mar 2012
 * @version 1.0.0
 *
 */

public interface IProductDAO {

	/**
	 * Add Product
	 * 
	 * @param  Product product
	 */
	public void addProduct(Product product);
	
	/**
	 * Update Product
	 * 
	 * @param  Product product
	 */
	public void updateProduct(Product product);
	
	/**
	 * Delete Product
	 * 
	 * @param  Product product
	 */
	public void deleteProduct(Product product);
	
	/**
	 * Get Product
	 * 
	 * @param  int Product Id
	 */
	public Product getProductById(Long id);
	
	/**
	 * Get Product List
	 * 
	 */
	public Page getProducts(PageRequest posPagination);

    public List<Product> searchProducts(String query);

    public Product getProduct(String name) throws ProductNotFoundException;

    public List<Product> searchProducts(SearchCriteria searchCriteria);
}
